package com.cqupt.scanning.system.statistics.service.impl;

import com.cqupt.scanning.system.admin.service.DeviceFootService;
import com.cqupt.scanning.system.admin.service.DeviceThreeService;
import com.cqupt.scanning.system.admin.service.PatientFootService;
import com.cqupt.scanning.system.admin.service.PatientThreeService;
import com.cqupt.scanning.system.statistics.service.StatisticsService;
import com.cqupt.scanning.system.utils.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Data: 2021/7/8 16:02
 * @Author: 宋宝梁
 */
@Service
public class StatisticsServiceImpl implements StatisticsService {

    private DeviceFootService deviceFootService;
    private DeviceThreeService deviceThreeService;
    private PatientFootService patientFootService;
    private PatientThreeService patientThreeService;




    @Autowired
    public StatisticsServiceImpl(DeviceFootService deviceFootService,
                                 PatientFootService patientFootService,
                                 PatientThreeService patientThreeService,
                                 DeviceThreeService deviceThreeService
                                ) {
        this.deviceFootService = deviceFootService;
        this.deviceThreeService = deviceThreeService;
        this.patientFootService = patientFootService;
        this.patientThreeService = patientThreeService;

    }

    @Override
    public R queryDevCount() {
        int devFootCount = deviceFootService.count(null);
        int devThreeCount = deviceThreeService.count(null);
        return R.ok().data("devFootCounts", devFootCount).data("devThreeCounts", devThreeCount);
    }

    @Override
    public R queryPatCount() {
        int patFootCount = patientFootService.count(null);
        int patThreeCount = patientThreeService.count(null);
        return R.ok().data("patFootCounts", patFootCount).data("patThreeCounts", patThreeCount);
    }

    @Override
    public R queryAppDoctorCount() {
        int doctorsFootCounts = patientFootService.count(null);
        int doctorsThreeCounts = patientThreeService.count(null);
        return R.ok().data("doctorsFootCounts", doctorsFootCounts).data("doctorsThreeCounts", doctorsThreeCounts);
    }

    @Override
    public R queryReportCount() {
        int patFootCount = patientFootService.count(null);
        int patThreeCount = patientThreeService.count(null);
        return R.ok().data("footReportsCounts", patFootCount).data("threeReportsCounts", patThreeCount);
    }

    @Override
    public R queryDetectDoctorCount() {
        int doctorsFootCounts = patientFootService.count(null);
        int doctorsThreeCounts = patientThreeService.count(null);
        return R.ok().data("doctorsFootCounts", doctorsFootCounts).data("doctorsThreeCounts", doctorsThreeCounts);
    }

}
